package cn.itrip.auth.service.toKen;

import cn.itrip.beans.pojo.ItripUser;

public interface TokenService {
    public static final int SESSION_TIMEOUT = 2*60*60;//2h
    public static final int REPLACEMENT_PROTECTION_TIMEOUT = 60*60;//1h
    public static final int REPLACEMENT_DELAY = 2*60;//2m
    //获取token
    public String generateToken(String agent, ItripUser user);
    //加入缓存保存token
    public void save(String token,ItripUser user);
    //
    public String replaceToken(String agent,String token) throws Exception;
    public void delete(String token);
    public ItripUser load(String token);
    public boolean exists(String token);
    public boolean validate(String agent,String token);

}
